<?php namespace App\Infra;

use App\Utils\ModelOperatorTrait;
use App\Models\Order;
class OrderManager{
	use ModelOperatorTrait;

	public function getOrders($conditions = null,$first = false,$union = []){
		return $this->findModel(Order::class,Order::query()->with($union),$conditions,$first);
	}

	public function updateOrder($conditions = null,$data = null){
		$this->update(Order::class,Order::query(),$conditions,$data);
	}

	public function createOrder($data){
		$this->create(Order::class,$data);
	}

	public function deleteOrder($conditions = null){
		$this->delete(Order::class,Order::query(),$conditions);
	}
}